package com.hualushui.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.hualushui.pojo.Account;
import com.hualushui.service.AccountService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping(value = "/account")
public class AccountController {

    @Reference(interfaceClass = AccountService.class,version = "1.0.0",check = false)
    private AccountService accountService;

    @RequestMapping(value = "/detai/{id}")
    public String accountDetail(@PathVariable("id") int id, Model model){
        Account account = accountService.queryAccountById(id);
        model.addAttribute("account",account);
        return "accountDetail";
    }
}
